package com.htj.erp.dao;
import java.util.List;

import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.htj.erp.model.jpa.Orderb;

/**
 * 
 *
 * OrderbDao
 * orderb dao 层
 * 使用JPA分页查询 一般继承com.kedacom.security.dao.BaseJpaDao
 *  public Page<PO> findByXXX(String xxx, Pageable pageable);
 * chenghongtao
 * 2016-11-07 11:59:35
 * HTJ
 * @version 1.0.0
 *
 */
@Repository
public interface OrderbDao extends QualiBaseDao<Orderb> {
	
	 @Modifying
	 @Query("delete from Orderb where orderh.id in ?1")
	 void delByOrderH(Long id);
	 
	 List<Orderb> findByDeliveryId(Long deliveryId);
		
	 List<Orderb> findByDeliveryId(Long deliveryId,Sort sort);
	 
	 @Query(" from Orderb where orderh.id = :orderhId order by recvName asc")
	 List<Orderb> findByOrderh(@Param("orderhId")Long orderhId);
	 
	 
	 
	 
}